//
// Created by Jisam on 15/09/2024 7:02 PM.
// Solution of  构造序列
#include <bits/stdc++.h>

using namespace std;

int main() {
    ios::sync_with_stdio(false);
    cin.tie(nullptr);
    int n,m;
    cin >> n >> m;
    if(n == m)cout << 2 * n;
    else   cout << min(n,m) * 2 + 1;
    return 0;
}